<?php
class Liste{
	private $id;
	private $label;
	private $values;
	function __construct($id) {

		if (is_int($id)){
			if($id >= 0){
				$this->id=$id;
			}else{
				throw new FieldFormatException($_SESSION['translator']->idVal);
			}
		}else{
			throw new FieldFormatException($_SESSION['translator']->idInt);
		}
	}
	function getId(){
		return $this->id;
	}
	function getLabel(){
		return $this->label;
	}
	function getValues(){
		return $this->values;
	}
	function setLabel($label){
		$this->label = $label;
	}
	function setValues($valuesTab){
		$bool=true;
		if(is_array($valuesTab)){
			foreach ($valuesTab as $value){
				if(!is_a($value, 'ListeValue')){
					$bool=false;
				}
				if($bool){
					$this->values=$valuesTab;
				}else{
					throw  new FieldFormatException($_SESSION['translator']->listEx." ListeValue");
				}
			}
		}else{
			throw  new FieldFormatException($_SESSION['translator']->arrayErr);
		}
	}
}
?>